﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClientNetwork;
using System.Data;
using System.ComponentModel;

namespace Client
{
    public class User : INotifyPropertyChanged
    {
        public String username;
        public String password;
        public String firstname;
        public String lastname;
        public String email;
        public String phone;


        public User()
        {
            
        }

        public DataTable CreateUser(String username,  String password, String firstname, String lastname, String email, String phone)
        {
            return Protocol.Command(SaunaProtocol.CreateUser, username + "," + password + "," + firstname + "," + lastname + "," + email + "," + phone);
        }

        public DataTable Login(String username, String password)
        {
            return Protocol.Command(SaunaProtocol.Login, username + "," + password);
        }

        public DataTable Logout(String username)
        {
            return Protocol.Command(SaunaProtocol.Logout, username);
        }

        public DataTable GetProfile(String username)
        {
            return Protocol.Command(SaunaProtocol.GetProfile, username);
        }

        public DataTable UpdateProfile(String username, String password, String firstname, String lastname, String email, String phone)
        {
            return Protocol.Command(SaunaProtocol.UpdateProfile, username + "," + password + "," + firstname + "," + lastname + "," + email + "," + phone);
        }

        public DataTable DeleteUser(String username)
        {
            return Protocol.Command(SaunaProtocol.DeleteUser, username);
        }

        public DataTable GetUserList(String username)
        {
            return Protocol.Command(SaunaProtocol.GetUserList, username);
        }



        public string FirstName
        {
            get { return firstname; }
            set
            {
                firstname = value;
            }
        }

        public string LastName
        {
            get { return lastname; }
            set
            {
                lastname = value;
            }
        }

        public string UserName
        {
            get { return username; }
            set
            {
                username = value;
            }
        }

        public string Password
        {
            get { return password; }
            set
            {
                password = value;
            }
        }

        public string Email
        {
            get { return email; }
            set
            {
                email = value;
            }
        }

        public string Phone
        {
            get { return phone; }
            set
            {
                phone = value;
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;
    }
}
